#ifndef _OBJECT_DIC_H_
#define _OBJECT_DIC_H_

typedef void (*entry_func)(void);
enum entry_type
{
    ENTRY_IDEL = 0,
    ENTRY_INT ,
    ENTRY_FLOAT ,
    ENTRY_FUNCTION ,
    ENTRY_IGNORE
};
struct entry
{
    int index;
    enum entry_type type;
    int int_data;
    float float_data;
    entry_func trigger_function;
};
#define ENTRY_MAX_NUMBER 16
struct object_dict 
{
    int can_id;
    struct entry entry_array[ENTRY_MAX_NUMBER];
};

//index|entry_type type|int_data|float_data|trigger_function|
int get_dict_entry(struct object_dict* od, int index, void* data_address, enum entry_type type);
int set_dict_entry(struct object_dict* od, int index, const void* data_address, enum entry_type type);
int call_dict_entry(struct object_dict* od, int index);
enum entry_type get_entry_type(const struct object_dict* od, int index);
#endif
